/**
 *  @file SDLTextRepresentation.h
 *
 *  @date 25-nov-2009
 *  @author Ives van der Flaas
 */

#ifndef SDLTEXTREPRESENTATION_H_
#define SDLTEXTREPRESENTATION_H_

#include <string>
#include <SDL_ttf.h>
#include <tr1/memory>
#include "SDLStaticRepresentation.h"
#include "SDLTypeSetter.h"
#include "SDLColor.h"
#include "SDLWindow.h"

namespace si_sdl
{
/**
 * Nice SDL based representation making use of our own sdl typesetter.
 * This typesets an entire text separated by \\n's. It can take "transparant"
 * as a background color if you want it to be transparant.
 */
class SDLTextRepresentation: public si_sdl::SDLStaticRepresentation
{
public:
	/**
	 * Typesets and entire text. Understands newlines...
	 * @param text Text to be typeset
	 * @param fontlocation Where I can find the font you would like to use
	 * @param ptSize Size of the font in points
	 * @param fontColor The font's color
	 * @param bgColor The background's color (can be transparant)
	 * @param align One of the TextAlignment options
	 * @return A shared_ptr to the SDL_Surface that contains the text
	 */
	SDLTextRepresentation(std::string text,
			std::string fontlocation,
			int ptSize,
			Color fontColor,
			Color bgColor,
			TextAlignment align);
	SDLTextRepresentation(){};
	void set(std::string text,
			std::string fontlocation,
			int ptSize,
			Color fontColor,
			Color bgColor,
			TextAlignment align);
	virtual ~SDLTextRepresentation();

private:
	std::tr1::shared_ptr<TTF_Font> fFont;
};

}

#endif /* SDLTEXTREPRESENTATION_H_ */
